package m3f.interact;

import m3f.backprojection.Combiner;
import m3f.data.MultimodalCachedLoader;
import m3f.data.MultimodalDataSet;
import m3f.data.SingleDataSet;

public class Backprojection {

	public static void run(String[] args) {
		if(args.length < 6){
			System.out.println("Parameters:\n" +
					"\t1 Database visual file\n" +
					"\t2 Queries visual file\n" +
					"\t3 P\n" +
					"\t4 H\n" +
					"\t5 U\n" +
					"\t6 alpha\n" +
					"\t7 beta\n" +
					"\t8 HBP\n" +
					"\t9 UBP\n");
			System.exit(0);
		}
		
		String database = args[1];
		String queries = args[2];
		String pFile = args[3];
		String h = args[4];
		String u = args[5];
		double alpha = Double.parseDouble(args[6]);
		double beta = Double.parseDouble(args[7]);
		String outputTraining = args[8];
		String outputTest = args[9];
		
		MultimodalCachedLoader trainingSet = new MultimodalCachedLoader(database, h, true);
		MultimodalDataSet testSet = new MultimodalDataSet(queries, u, true);
		SingleDataSet P = new SingleDataSet(pFile, false);
		Combiner.writeCombinedRepresentation(trainingSet, testSet, P, alpha, beta, outputTraining, outputTest);
		
	}

}
